package com.hanthink.web.controller.app.repair;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hanthink.common.constant.HttpStatus;
import com.hanthink.common.core.page.TableDataInfo;
import com.hanthink.system.domain.repair.RepairRecordFileVo;
import com.hanthink.system.domain.repair.RequestFileInfo;
import com.hanthink.system.service.repair.IRequestFileInfoService;

@RestController
@RequestMapping("/app/repair/requestFile")
public class RequesFiletInfoControll {

	@Autowired
	private IRequestFileInfoService requestFileInfoService;

	/**
	 * 根据报修单ID查询报修多媒体文件信息
	 * 
	 * @param siteKey
	 * @return
	 */
	@PostMapping("/selectFiles")
	public TableDataInfo SelectFileByRequestId(@RequestBody RequestFileInfo requestFileInfo) {
		List<RequestFileInfo>  files = requestFileInfoService.SelectFileByRequestId(requestFileInfo.getRequestId());
		TableDataInfo rspData = new TableDataInfo();
		rspData.setCode(HttpStatus.SUCCESS);
		rspData.setRows(files);
		rspData.setMsg("操作成功");
		return rspData;
	}
	
	/**
	 * 根据维修单D查询报修多媒体文件信息
	 * 
	 * @param siteKey
	 * @return
	 */
	@PostMapping("/selectRepairFiles")
	public TableDataInfo SelectRepairFileByRequestId(@RequestBody RepairRecordFileVo requestFileInfo) {
		List<RepairRecordFileVo>  files = requestFileInfoService.SelectRepairFileByRequestId(requestFileInfo.getRequestId());
		TableDataInfo rspData = new TableDataInfo();
		rspData.setCode(HttpStatus.SUCCESS);
		rspData.setRows(files);
		rspData.setMsg("操作成功");
		return rspData;
	}

	@PostMapping("/selectRepairFilesnew")
	public TableDataInfo SelectRepairFileByRequestIdnew(@RequestBody RepairRecordFileVo requestFileInfo) {
		List<RepairRecordFileVo>  files = requestFileInfoService.SelectRepairFileByRequestIdnew(requestFileInfo.getRequestId());
		TableDataInfo rspData = new TableDataInfo();
		rspData.setCode(HttpStatus.SUCCESS);
		rspData.setRows(files);
		rspData.setMsg("操作成功");
		return rspData;
	}


	@PostMapping("/selectRequestFilesnew")
	public TableDataInfo selectRequestFilesnew(@RequestBody RepairRecordFileVo requestFileInfo) {
		List<RepairRecordFileVo>  files = requestFileInfoService.selectRequestFilesnew(requestFileInfo.getRequestId());
		TableDataInfo rspData = new TableDataInfo();
		rspData.setCode(HttpStatus.SUCCESS);
		rspData.setRows(files);
		rspData.setMsg("操作成功");
		return rspData;
	}


}
